package org.nepu.scr.indexrate.converter.upgraderate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.upgraderate.operationreliability.AppendixC1;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class AppendixC1Converter implements AttributeConverter<AppendixC1, String> {
    @Override
    public String convertToDatabaseColumn(AppendixC1 appendixC1) {
        return JSONUtil.toJsonStr(appendixC1);
    }

    @Override
    public AppendixC1 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, AppendixC1.class);
    }
}
